package cn.summit.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletRequest;
import java.util.Map;

/**
 * @author summit
 * @since 2019/9/14 22:45
 */
@Controller
public class MyTestController {

    @PostMapping("/test")
    @ResponseBody
    public String helloword() {
        return  "helloword";
    }

    @GetMapping("/noauth")
    public String noauth() {
        return "user/noauth";
    }

    @GetMapping("/index")
    public String getMyfirst(Map<String, Object> map) {

        map.put("who", "summit");
        return "Myfirst";
    }
    @GetMapping("/t1/add")
    public String add() {
        return "/user/add";
    }
    @GetMapping("/t2/update")
    public String update() {
        return "/user/update";
    }

    @PostMapping("/login2")
    public void login2(ServletRequest request) {
        System.out.println("1234567");
    }

//    @GetMapping("/loginpage")
//    public String login() {
//        return "/mylogin";
//    }
}
